﻿Imports System.Runtime.CompilerServices
Imports System.Globalization

Module ModGlobals
    <Extension()> _
    Function CapitalizeAll(ByVal sString As String) As String
        Return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(sString)
    End Function
End Module
'Public Shared Function CapitalizeWords(ByVal value As String) As String
'    If value = Nothing Then
'        Throw New ArgumentNullException("value")
'    End If
'    If value.Length = 0 Then
'        Return value
'    End If

'    Dim result As New StringBuilder(value)
'    result(0) = Char.ToUpper(result(0))
'    Dim i As Integer = 1
'    While i < result.Length
'        If Char.IsWhiteSpace(result(i - 1)) Then
'            result(i) = Char.ToUpper(result(i))
'        End If
'        System.Threading.Interlocked.Increment(i)
'    End While
'    Return result.ToString()
'End Function